import { getHomeList } from "../api/api";
const homeList ={
    state: {
        homeList: ''
    },
    mutations: {
        SET_HOME_LIST(state, homeList) {
            state.homeList = homeList;
        }
    },
    actions: {
        async setHomeList({ commit }) {
          const res = await getHomeList();
          if (res.code !== 200) {
            commit("SET_HOME_LIST", res.data.data);
            console.log("获取列表成功", res.data.data);
          } else {
            console.log("获取列表失败");
          }
        }
    },
    getters: {
        orderRank(state) {
            return state.homeList.orderRank;
        },
        userRank(state) {
            return state.homeList.userRank;
        },
        seeRank(state) {
            return state.homeList.seeRank;
        }
    }
}
export default homeList;